package com.seckillpro.seckill_pro.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.seckillpro.seckill_pro.pojo.TOrder;
import com.seckillpro.seckill_pro.pojo.TUser;
import com.seckillpro.seckill_pro.vo.GoodsVo;
import com.seckillpro.seckill_pro.vo.OrderDetailVo;


/**
 * <p>
 * 服务类
 * </p>
 *
 * @author lyx
 * @since 2021-03-05
 */
public interface ITOrderService extends IService<TOrder> {


    /**
     * 秒杀商品
     *
     * @param user
     * @param goods
     * @return
     */
    TOrder secKill(TUser user, GoodsVo goods);

    /**
     * 功能描述：订单详情
     *
     * @param orderId 订单id
     * @return 订单详情返回对象
     */
    OrderDetailVo detail(Long orderId);

    /**
     * 创建path
     *
     * @param user
     * @param goodId
     * @return
     */
    String createPath(TUser user, Long goodId);

    /**
     * 校验path的合法性
     *
     * @param user
     * @param goodId
     * @return
     */
    boolean checkPath(TUser user, Long goodId, String path);

    /**
     * 验证码校验
     *
     * @param user
     * @param goodId
     * @param captcha
     * @return
     */
    boolean checkCaptcha(TUser user, Long goodId, String captcha);
}
